﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace LanguageTraning
{
    class NamedAndOptionalArguments
    {
        public void ExampleMethod(int required, string optionalstr = "default string", int optionalint = 10)
        {
            Console.WriteLine(required.ToString() +  optionalstr);
        }


        public void TestMethod()
        {
            Console.WriteLine("---------------------------------------------");
            Console.WriteLine("this is example of {0}", this.GetType().ToString());

            ExampleMethod(0);
            ExampleMethod(0,"this is for optiona argument");
            ExampleMethod(0, "first", 11);
            
            ExampleMethod(optionalint: 11, optionalstr: "this is named argument", required :0);
            
        }

    }
}
